package com.me.aop.dao;

import com.me.aop.pojo.T1;
import com.me.aop.pojo.T2;
import org.springframework.stereotype.Repository;
import com.me.aop.annotation.Victor;

/**
 * AOP学习: 模拟出来的目标对象
 *
 * @author ME
 * @date   2019/11/13
 */
@Repository("indexDao")
public class IndexDaoImpl implements IndexDao {

    @Override
    public void query() {
        System.out.println("\tIndexDaoImpl: Execute indexDao.query()");
    }

    @Override
    public void query(Integer i) {
        System.out.println("\tIndexDaoImpl: Execute indexDao.query(Integer i)");
    }

    @Override
    public void query(String str) {
        System.out.println("\tIndexDaoImpl: Execute indexDao.query(String str)");
        System.out.println("\tIndexDaoImpl: args: \"" + str + "\"");
    }

    @Override
    @Victor
    public void query(Integer i, String str) {
        System.out.println("\tIndexDaoImpl: Execute indexDao.query(Integer i, String str)");
    }

    @Override
    public void query(T1 t1) {
        System.out.println("\tIndexDaoImpl: Execute indexDao.query(T1 t1)");
    }

    /**
     * TODO 这种配置无效：@Victor T2 t2
     * @param t2
     */
    @Override
    public void query(@Victor T2 t2) {
        System.out.println("\tIndexDaoImpl: Execute indexDao.query(T2 t2)");
    }
}
